package main

import "fmt"

func main() {

	//var a func(int, int)

	a := callback

	sumandcut(10, 5, a)
	connect()
}

func callback(a, b int) {
	fmt.Println(a, b)
}

func sumandcut(a, b int, c func(int, int)) {
	sum := a + b
	cut := a - b
	c(sum, cut)
	return
}

func connect() {
	fmt.Println("连接数据库")

	defer fmt.Println("释放连接")
	defer fmt.Println("释放连接1")

	fmt.Println("执行sql")
	fmt.Println("取到数据")

}
